const express = require('express');
const orderCtrl = require('../../app/controllers/order.server.controller.js');

module.exports = (app) => {
    const router = express.Router();

    router.route('/addOrder')
        .post(orderCtrl.addOrder);

    router.route('/getOrderByCustomerId/:customerId')
        .get(orderCtrl.getAllOrderByCustomerId);

    router.route('/getOrderWithStateByMerchantId/:state')
        .get(orderCtrl.getOrderWithStateByMerchantId);

    router.route('/updateOrderStateByOrderId/:state/:orderId')
        .post(orderCtrl.updateOrderStateByOrderId);

    app.use('/order', router);
};